package com.zelin.sellergoods.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.zelin.dao.ItemDao;
import com.zelin.entity.ItemEntity;
import com.zelin.sellergoods.service.ItemService;
import com.zelin.utils.PageUtils;
import com.zelin.utils.Query;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;


@Service
public class ItemServiceImpl extends ServiceImpl<ItemDao, ItemEntity> implements ItemService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<ItemEntity> page = this.page(
                new Query<ItemEntity>().getPage(params),
                new QueryWrapper<ItemEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<ItemEntity> findItemsbyGoodsId(Long... ids) {
        return this.baseMapper.selectList(new QueryWrapper<ItemEntity>().in("goods_id",ids));
    }

}